package com.wanmait.translate.supplier.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.translate.pojo.SupplierInfo;
import com.wanmait.translate.supplier.mapper.SupplierInfoMapper;
import com.wanmait.translate.supplier.service.SupplierInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Author guang
 * @Description : 历史供应商信息
 * @Date 10:47 2020-11-12
 **/
@Service
@Transactional(rollbackFor = Exception.class)
public class SupplierInfoServiceImpl implements SupplierInfoService {

    @Resource
    private SupplierInfoMapper supplierInfoMapper;

    @Override
    public PageInfo<SupplierInfo> findAll(int pageNum){
        int pageSize = 5;
        PageHelper.startPage(pageNum, pageSize);
        List<SupplierInfo> supplierInfos = supplierInfoMapper.findAll();
        PageInfo<SupplierInfo> pageInfo = new PageInfo<>(supplierInfos);
        return pageInfo;
    }

}
